﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AMing.Core.Extension
{
    public static class TimeSpanExtension
    {
        /// <summary>
        /// 转成HH:mm:ss
        /// </summary>
        /// <param name="timeSpan"></param>
        /// <returns></returns>
        public static string ToString_HHmmss(this TimeSpan timeSpan)
        {
            return string.Format("{0:D2}:{1:D2}:{2:D2}", timeSpan.Hours, timeSpan.Minutes, timeSpan.Seconds);
        }
        /// <summary>
        /// 转成mm:ss
        /// </summary>
        /// <param name="timeSpan"></param>
        /// <returns></returns>
        public static string ToString_mmss(this TimeSpan timeSpan)
        {
            return string.Format("{0:D2}:{1:D2}",  timeSpan.Minutes, timeSpan.Seconds);
        }
    }
}
